<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/admin/include/init_admin.jsp" %>
<%@ page import="com.welfare.admin.call.*" %>
<%

	
	String manual_id		= StringUtil.nvl(request.getParameter("manual_id"));



	HashMap infos = new HashMap();
	infos.put("manual_id",	manual_id);


	CallDAO dao 		= new CallDAO();
	HashList info		= dao.selectManualInfo(infos);		
	HashList fileList	= CommonUtil.getFileList(StringUtil.nvl(info.get("file_ref_id",0)));
	
	dao.updateManualHitCount(infos);


%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title><%= SYSTEM_NAME %></title>
	<%@ include file="/admin/include/cssnjs.jsp"  %>

	<script type="text/javascript">
	
	
	$(document).ready(function() {
		
	});


	function fnDelete() {
		if (confirm(MSG_D)) {
			$('#saveForm').submit();
		}
	}
	
	

	
	function fnExcelDownload() {
		document.excelForm.excel_data.value = $('#excel_data').html();
		document.excelForm.submit();
	}


	</script>
</head>
<body>
<div id="wrap">
		<div id="popup">
		
			<form name="saveForm" id="saveForm" method="post" action="./manualSave.do" >
			<input type="hidden" name="job_type" id="job_type" value="D"/>
			<input type="hidden" name="manual_id" value="<%= info.get("manual_id", 0) %>"/>
			</form>
			
			<form name="excelForm" method="post" action="/common/excel_view.jsp">
				<input type="hidden" name="excel_title" value="내부게시판"/>
				<input type="hidden" name="excel_data" value=""/>
			</form>
			
			<div class="menu_title">
				<h1>내부게시판</h1>
				<div class="r mt2">
			<%	if (isAdmin) { %>
					<a href="./manualUpdate.jsp?manual_id=<%=manual_id %>" ><img src="../images/btn_update.gif"/></a>
					<a href="#nohref" onclick="fnDelete()"><img src="../images/btn_delete.gif" /></a>
			<%	} %>
					<a href="#nohref" onclick="window.print()"><img src="../images/btn_print.gif"/></a>
					<a href="#nohref" onclick="fnExcelDownload()"><img src="../images/btn_excel.gif"/></a>
					<input type="image" class="button" src="../images/btn_close.gif" onclick="self.close()"/>
				</div>
			</div>
			<div class="clear line_01"></div>

			<div id="excel_data">
			<table cellpadding="0" cellspacing="0" class="table_01 mt5">
			<colgroup>
				<col width="80px"/>
				<col/>
				<col width="80px"/>
				<col/>
				<col width="80px"/>
				<col/>
			</colgroup>
			<tbody>
				<tr>
					<th><p>분류1</p></th>
					<td>
						<%= info.get("counsel_kind_name", 0) %>
					</td>
					<th><p>분류2</p></th>
					<td>
						<%= info.get("counsel_part_name", 0) %>
					</td>
					<th><p>공지여부</p></th>
					<td>
						<%= info.get("notice_yn", 0) %>
					</td>
				</tr>
				<tr>
					<th><p>제목</p></th>
					<td colspan="5">
						<%= info.get("subject", 0) %>
					</td>
				</tr>
				<tr>
					<th><p>내용</p></th>
					<td colspan="5" style="min-height:200px; vertical-align:top">
						<%= info.get("content_info", 0) %>
					</td>
				</tr>
				<tr>
					<th><p>기타사항</p></th>
					<td colspan="5">
						<%= info.getToBr("etc_info", 0) %>
					</td>
				</tr>
				<tr>
					<th><p>첨부파일</p></th>
					<td colspan="5">
			<%		for (int i = 0; i < fileList.size(); i++) { %>
						<span class="file_download">
							<a href="./manualDownload.jsp?file_id=<%= fileList.get("file_id", i) %>">
							<img src="../../images/common/<%= StringUtil.getFileExtIcon(fileList.get("file_ext",i)) %>"/><%= fileList.get("file_name",i) %></a><%= i<fileList.size()-1?",":"" %>
						</span>
			<%		} %>
					</td>
				</tr>
			</tbody>	
			</table>
			</div>
		</div>
	</div>



</body>
</html>
